package com.shide.flow.demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shide.flow.demo.entity.FlowProcess;
import com.shide.flow.demo.service.FlowProcessService;
import com.shide.flow.demo.mapper.FlowProcessMapper;
import org.springframework.stereotype.Service;

/**
 * @author shide56
 * @description 针对表【flow_process(流程定义表)】的数据库操作Service实现
 * @createDate 2024-11-20 15:09:31
 */
@Service
public class FlowProcessServiceImpl extends ServiceImpl<FlowProcessMapper, FlowProcess>
        implements FlowProcessService {

    /**
     * 根据 key 获取 流程定义对象
     *
     * @param processKey 流程定义key
     * @return 流程定义对象
     */
    @Override
    public FlowProcess getProcessByKey(String processKey) {
        return this.getOne(new LambdaQueryWrapper<FlowProcess>()
                .eq(FlowProcess::getProcessKey, processKey));
    }
}




